package cn.iocoder.boot.kmeans;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class DataGenerator {
    public static List<Talent> generateSampleTalents(int numTalents) {
        List<Talent> talents = new ArrayList<>();
        Random random = new Random();
        String[] names = {"Alice", "Bob", "Charlie", "David", "Eve", "Frank", "Grace", "Helen", "Ivy", "Jack"};
        for (int i = 0; i < numTalents; i++) {
            int experience = random.nextInt(10) + 1;
            int skill = random.nextInt(experience + 1) + 1;
            if (skill > 10) {
                skill = 10;
            }
            int education = random.nextInt(11);
            double weightedSum = skill * 0.65 + experience * 0.25 + education * 0.10;
            int salary = (int) (3000 + (weightedSum / 10) * 17000);
            salary = Math.max(3000, Math.min(salary, 20000));
            talents.add(new Talent(names[i % names.length], new int[]{skill, experience, education}, salary));
        }
        return talents;
    }
}